package com.ruoyi.sports.domain;

import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * @ClassName Post
 * @Description TODO
 * @Author JH Z
 * @Date 2023/3/12 19:07
 * @Version 1.0
 */
public class Post extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 公告ID */
    private Long postId;

    /** 公告标题 */
    private String postTitle;


    /** 公告内容 */
    private String postContent;

    /** 公告状态（0正常 1关闭） */
    private String status;

    public Long getPostId()
    {
        return postId;
    }

    public void setPostId(Long postId)
    {
        this.postId = postId;
    }

    public void setPostTitle(String postTitle)
    {
        this.postTitle = postTitle;
    }

    @Xss(message = "帖子标题不能包含脚本字符")
    @NotBlank(message = "帖子标题不能为空")
    @Size(min = 0, max = 50, message = "帖子标题不能超过50个字符")
    public String getPostTitle()
    {
        return postTitle;
    }

    public void setPostContent(String postContent)
    {
        this.postContent = postContent;
    }

    public String getPostContent()
    {
        return postContent;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("noticeId", getPostId())
                .append("noticeTitle", getPostTitle())
                .append("noticeContent", getPostContent())
                .append("status", getStatus())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
